import axiosReq from '@/utils/axios-req'
const BASE_URL = import.meta.env.VITE_APP_BASE_URL_SYH

// 获取评标报告动态值
export const getReviewReportDynamicValue = () => {
  const id = useProjectInfoStore().projectInfo.id
  return axiosReq({
    baseURL: BASE_URL,
    url: `/cloud/pbgl/bidReport/getBidReport`,
    method: 'POST',
    data: {
      id
    }
  })
}

/**
 * 更新评标报告动态值
 * @param data 
 * {
  "projectId": 1,
  "mediaNameSelect": "中国招标投标公共服务平台,招标投标网",
  "mediaNameInput": "私人采购",
  "bidRemark": "测试备注",
  "baseRank": "是",
  "baseRankRemark": ""
}
 * @returns 
 */
export const updateReviewReportDynamicValue = (data: any) => {
  const projectId = useProjectInfoStore().projectInfo.id
  return axiosReq({
    baseURL: BASE_URL,
    url: `/cloud/pbgl/bidReport/updateBidReport`,
    method: 'POST',
    data: {
      ...data,
      projectId
    },
    showMsg: true
  })
}

export const getProjectStatus = () => {
  const id = useProjectInfoStore().projectInfo.id
  return axiosReq({
    baseURL: BASE_URL,
    url: `/cloud/pbgl/projectInfo/getProjectStatus`,
    method: 'POST',
    data: {
      id
    }
  })
}
